<?php
/**
 * 子应用入口
 * @param  array
 * @return [type]
 */
function run_home_app($uri = array()) {
	$page = isset($uri[2]) ? intval($uri[2]) : 1;
	home_show_page($page);
}
/**
 *显示home页面
 */
function home_show_page($page = 1) {
	$page = intval($page);
	if ($page <= 0) {
		$page = 1;
	}
	$home_file = POST_HTML_PATH . 'index.html';
	// app start.
	if (is_file($home_file) && (time() - filemtime($home_file) < 1200) && !IS_DEBUG) {
		include $home_file;
	} else {
		require_once APP_PATH . DIRECTORY_SEPARATOR . 'home/build.php';
		$home_file_content = home_build_page($page);
		echo $home_file_content;
	}

}